<template>
  <div class="app-logo cursor-pointer mb-lg" @click="navigateToHome">
    <h2 class="title">{{ moduleName }}</h2>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'

interface Props {
  moduleName: string
}

defineProps<Props>()

const router = useRouter()

const navigateToHome = () => {
  router.push('/home')
}
</script>

<style scoped>
.app-logo {
  padding: var(--spacing-xs) 0;
  transition: all 0.3s;
  border-bottom: 2px solid transparent;
  display: inline-block;
}

.app-logo .title {
  color: #606266;
  margin: 0;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  letter-spacing: 1px;
}

.app-logo:hover {
  border-bottom-color: #409EFF;
}

.app-logo:hover .title {
  color: #409EFF;
}
</style>
